Selenium/How-to/Debug with Visual Studio Code
![]() | Code from this page is available at mediawiki/core and gerrit:1055406. |
Environments
[edit]This tip works if you're targeting:
- a local MediaWiki
- a remote wiki
launch.json
[edit]Create .vscode/launch.json
file.
{
"version": "0.2.0",
"configurations": [
{
"name": "run select spec",
"type": "node",
"request": "launch",
"args": [ "tests/selenium/wdio.conf.js", "--spec", "${file}" ],
"cwd": "${workspaceFolder}",
"autoAttachChildProcesses": true,
"program": "${workspaceRoot}/node_modules/@wdio/cli/bin/wdio.js",
"console": "integratedTerminal",
"skipFiles": [
"${workspaceFolder}/node_modules/**/*.js",
"${workspaceFolder}/lib/**/*.js",
"<node_internals>/**/*.js"
]
}
]
}
Make the browser visible
[edit]To make the browser visible, see Selenium/How-to/Make the browser visible.
Run Selenium tests
[edit]Open a file in tests/selenium/specs
folder in VSCode. Click Run > Start Debugging
.